home *** CD-ROM | disk | FTP | other *** search
- /*
- File: PIGeneral.h
-
- Copyright 1992-95 by Adobe Systems, Inc. All rights reserved.
-
- This file describes the elements common to all plug-in interfaces.
- */
-
- #ifndef __PIGeneral__
- #define __PIGeneral__
-
- #include "PITypes.h"
-
- #if !MSWindows && !THINK_C
- #pragma options align=mac68k
- #endif
-
- #if defined(__BORLANDC__)
- #pragma option -a-
- #endif
-
- #if MSWindows
- /* The following macros are part of PIGeneral.r on the Mac. We need to have access */
- /* to those macros in a header file. This file should be updated to reflect the */
- /* changes made to PIGeneral.r. */
-
- #define PIVersion "3.00"
- #define ProductVersion 3,0,0x80,0
-
- #define supportsBitmap 1
- #define supportsGrayScale 2
- #define supportsIndexedColor 4
- #define supportsRGBColor 8
- #define supportsCMYKColor 16
- #define supportsHSLColor 32
- #define supportsHSBColor 64
- #define supportsMultichannel 128
- #define supportsDuotone 256
- #define supportsLABColor 512
-
- #define latestAcquireVersion 4
- #define latestAcquireSubVersion 0
- #define latestExportVersion 4
- #define latestExportSubVersion 0
- #define latestExtensionVersion 1
- #define latestExtensionSubVersion 0
- #define latestFilterVersion 4
- #define latestFilterSubVersion 0
- #define latestFormatVersion 1
- #define latestFormatSubVersion 0
-
- #endif
-
- /********************************************************************************/
-
- /* The following error codes are available for all plug-ins. */
-
- #define errPlugInHostInsufficient -30900
- /* "the plug-in requires services not provided by this host." */
-
- #define errPlugInPropertyUndefined -30901
- /* "a requested property could not be found. */
-
- /********************************************************************************/
-
- #define PIKindProperty 0x6b696e64L /* 'kind' <OSType> giving the plug-in's kind */
- #define PIVersionProperty 0x76657273L /* 'vers' <int32> Major<int16>.Minor<int16> version number. */
- #define PIPriorityProperty 0x70727479L /* 'prty' <int32> Load order priority */
- #define PIImageModesProperty 0x6d6f6465L /* 'mode' <FlagSet> Image modes supported flags. (bitmask) */
- #define PIRequiredHostProperty 0x686f7374L /* 'host' <OSType> giving host required if any. */
- #define PICategoryProperty 0x63617467L /* 'catg' <PString> Category name that appears on top level menu. */
- #define PINameProperty 0x6e616d65L /* 'name' <PString> Menu name. */
- #define PI68KCodeProperty 0x6d36386bL /* 'm68k' <PI68KCodeDesc> 68k code descriptor. See type below. */
- #define PI68KFPUCodeProperty 0x36386670L /* '68fp' <PI68KCodeDesc> 68k w/FPU code descriptor. See type below. */
- #define PIPowerPCCodeProperty 0x70777063L /* 'pwpc' <PICFMCodeDesc> PowerPC code descriptor. See type below. */
- #define PIWin32X86CodeProperty 0x77783836L /* 'wx86' <PIWin32X86CodeDesc> Win32 Intel code descriptor. See type below */
- #define PIWin16X86CodeProperty 0x66783836L /* 'fx86' <PIWin16X86CodeDesc> Win16 Intel code descriptor. See type below */
-
- /********************************************************************************/
-
- /* Structures that directly represent resources. */
-
- #define kCurrentPiPLVersion 0
-
- typedef struct PIProperty
- {
- OSType vendorID; /* Vendor specific identifier. */
- OSType propertyKey; /* Identification key for this property type. */
- int32 propertyID; /* Index within this property type. Must be unique for properties of a given type in a PiPL. */
- int32 propertyLength; /* Length of following data array. Will be rounded to a multiple of 4. */
- char propertyData [1]; /* propertyLength bytes long. Must be a multiple of 4. Can be zero? */
- } PIProperty;
-
- typedef struct PIPropertyList
- {
- int32 version; /* Properties datastructure version number. */
- int32 count; /* Number of properties contained. */
- PIProperty properties[1]; /* The actual properties. */
- } PIPropertyList;
-
- typedef PIPropertyList **PIPropertyListHandle;
-
- /* Below are structures describing types used in plug-in property lists.
- * These structure obey Macintosh 68k alignment and padding rules though
- * generally they are laid out so fields have natural alignment and any
- * needed padding is explicit in the structure.
- *
- * In addition to these structure types, simple types such as int32, int16,
- * etc. are used. Two other examples are PString and FlagSet. PString is like a
- * rez pstring or a Str255 except that storage maynot be present for all
- * 255 characters. The initial length byte is present in the property.
- * FlagSet is a variable length bitstring in which the first member is
- * represented by the most significant bit of the first byte, the eighth
- * member is in the least significant bit of the first byte, etc. The length
- * of the set is kept in the property's length field of course.
- *
- * Arrays are also used in places with bounds either taken from the
- * property length or explicitly represented within the property.
- */
-
- typedef struct PI68KCodeDesc
- {
- OSType fType;
- int16 fID;
- } PI68KCodeDesc;
-
- typedef struct PICFMCodeDesc
- {
- long fContainerOffset;
- long fContainerLength;
- char fEntryName[1];
- } PICFMCodeDesc;
-
- typedef struct PIWin32X86CodeDesc
- {
- char fEntryName[1];
- } PIWin32X86CodeDesc;
-
- typedef struct PIWin16X86CodeDesc
- {
- char fEntryName[1];
- } PIWin16X86CodeDesc;
-
- typedef struct TypeCreatorPair
- {
- OSType type;
- OSType creator;
- } TypeCreatorPair;
-
- /********************************************************************************/
-
- typedef struct PlugInInfo
- {
-
- int16 version; /* The version number of the interface supported. */
- int16 subVersion; /* The sub-version number. */
- int16 priority; /* The plug-in's priority. */
- int16 generalInfoSize; /* The size of the general info. */
- int16 typeInfoSize; /* The size of the type specific info. */
- int16 supportsMode; /* A bit mask indicating supported image modes. */
- OSType requireHost; /* A required host if any. */
-
- }
- PlugInInfo;
-
- #if !MSWindows && !THINK_C
- #pragma options align=reset
- #endif
-
- typedef struct PSBuffer *BufferID;
-
- #define kPIGeneralInfoSize 16
-
- /* Image modes */
-
- #define plugInModeBitmap 0
- #define plugInModeGrayScale 1
- #define plugInModeIndexedColor 2
- #define plugInModeRGBColor 3
- #define plugInModeCMYKColor 4
- #define plugInModeHSLColor 5
- #define plugInModeHSBColor 6
- #define plugInModeMultichannel 7
- #define plugInModeDuotone 8
- #define plugInModeLabColor 9
- #define plugInModeGray16 10
- #define plugInModeRGB48 11
-
- /* The Window procID for a Moveable Modal Dialog window that can be used
- * under System 6. WDEF(128) is part of Photoshop.
- */
-
- #define PSmovableDBoxProc (128*16+5)
-
- /* Other commonly used structures */
-
- typedef int16 PlaneMap [16];
-
- typedef struct PlugInMonitor
- {
- Fixed gamma;
- Fixed redX;
- Fixed redY;
- Fixed greenX;
- Fixed greenY;
- Fixed blueX;
- Fixed blueY;
- Fixed whiteX;
- Fixed whiteY;
- Fixed ambient;
- }
- PlugInMonitor;
-
- /* The following structures reflect the version 1 structure for PSPixelMaps. */
-
- typedef struct PSPixelMask
- {
- struct PSPixelMask *next;
- void *maskData;
- int32 rowBytes;
- int32 colBytes;
- int32 maskDescription;
- }
- PSPixelMask;
-
- #define kSimplePSMask 0
- #define kBlackMatPSMask 1
- #define kGrayMatPSMask 2
- #define kWhiteMatPSMask 3
- #define kInvertPSMask 4
-
- typedef struct PSPixelMap
- {
- int32 version;
- VRect bounds;
- int32 imageMode;
- int32 rowBytes;
- int32 colBytes;
- int32 planeBytes;
- void *baseAddr;
-
- /* Fields new in version 1. */
-
- PSPixelMask *mat;
- PSPixelMask *masks;
- int32 maskPhaseRow; /* Used for setting the phase of the checkerboard. */
- int32 maskPhaseCol;
- }
- PSPixelMap;
-
- typedef struct ColorServicesInfo
- {
- int32 infoSize;
- int16 selector;
- int16 sourceSpace;
- int16 resultSpace;
- Boolean resultGamutInfoValid;
- Boolean resultInGamut;
- void *reservedSourceSpaceInfo; /* Must be NULL. (Will return paramErr if not.) */
- void *reservedResultSpaceInfo; /* Must be NULL. (Will return paramErr if not.) */
- int16 colorComponents[4];
- void *reserved; /* Must be NULL. (Will return paramErr if not.) */
- Str255 *pickerPrompt;
- }
- ColorServicesInfo;
-
- /* Constants for resultSpace and sourceSpace fields. */
- #define plugIncolorServicesRGBSpace 0
- #define plugIncolorServicesHSBSpace 1
- #define plugIncolorServicesCMYKSpace 2
- #define plugIncolorServicesLabSpace 3
- #define plugIncolorServicesGraySpace 4
- #define plugIncolorServicesHSLSpace 5
- #define plugIncolorServicesXYZSpace 6
-
- /* Only valid in the resultSpace field. Says leave the color in the space the user chose.
- * Custom colors will be returned in an arbitrary space possibly depending on the book.
- */
- #define plugIncolorServicesChosenSpace -1
-
- /* Color Service Selectors. */
- #define plugIncolorServicesChooseColor 0
- #define plugIncolorServicesConvertColor 1
-
- #ifdef __cplusplus
-
- extern "C"
- {
- #endif
-
- typedef MACPASCAL Boolean (*TestAbortProc) (void);
-
- typedef MACPASCAL void (*ProgressProc) (int32 done, int32 total);
-
- typedef MACPASCAL void (*HostProc) (int16 selector, int32 *data);
-
- typedef MACPASCAL int32 (*SpaceProc) (void);
-
- typedef MACPASCAL Handle (*NewPIHandleProc) (int32 size);
-
- typedef MACPASCAL void (*DisposePIHandleProc) (Handle h);
-
- typedef MACPASCAL int32 (*GetPIHandleSizeProc) (Handle h);
-
- typedef MACPASCAL OSErr (*SetPIHandleSizeProc) (Handle h, int32 newSize);
-
- typedef MACPASCAL Ptr (*LockPIHandleProc) (Handle h, Boolean moveHigh);
-
- typedef MACPASCAL void (*UnlockPIHandleProc) (Handle h);
-
- typedef MACPASCAL void (*RecoverSpaceProc) (int32 size);
-
- typedef MACPASCAL OSErr (*AllocateBufferProc) (int32 size, BufferID *bufferID);
-
- typedef MACPASCAL Ptr (*LockBufferProc) (BufferID bufferID, Boolean moveHigh);
-
- typedef MACPASCAL void (*UnlockBufferProc) (BufferID bufferID);
-
- typedef MACPASCAL void (*FreeBufferProc) (BufferID bufferID);
-
- typedef MACPASCAL int32 (*BufferSpaceProc) (void);
-
- typedef MACPASCAL int16 (*CountPIResourcesProc) (ResType type);
-
- typedef MACPASCAL Handle (*GetPIResourceProc) (ResType type, int16 index);
-
- typedef MACPASCAL void (*DeletePIResourceProc) (ResType type, int16 index);
-
- typedef MACPASCAL OSErr (*AddPIResourceProc) (ResType type, Handle data);
-
- typedef MACPASCAL void (*ProcessEventProc) (void *event);
-
- typedef MACPASCAL OSErr (*DisplayPixelsProc) (const PSPixelMap *source,
- const VRect *srcRect,
- int32 dstRow,
- int32 dstCol,
- void *platformContext);
-
- typedef MACPASCAL OSErr (*AdvanceStateProc) (void);
-
- typedef MACPASCAL OSErr (*GetPropertyProc) (OSType signature,
- OSType key,
- int32 index,
- int32 *simpleProperty,
- Handle *complexProperty);
-
- typedef MACPASCAL OSErr (*ColorServicesProc) (ColorServicesInfo *info);
-
- #ifdef __cplusplus
- }
- #endif
-
- #define kCurrentBufferProcsVersion 2
-
- typedef struct BufferProcs
- {
-
- int16 bufferProcsVersion;
-
- int16 numBufferProcs;
-
- AllocateBufferProc allocateProc;
-
- LockBufferProc lockProc;
-
- UnlockBufferProc unlockProc;
-
- FreeBufferProc freeProc;
-
- BufferSpaceProc spaceProc;
-
- }
- BufferProcs;
-
- #define kCurrentBufferProcsCount \
- ((sizeof(BufferProcs) - offsetof(BufferProcs, allocateProc)) / sizeof(void *))
-
- #define kCurrentResourceProcsVersion 3
-
- typedef struct ResourceProcs
- {
-
- int16 resourceProcsVersion;
-
- int16 numResourceProcs;
-
- CountPIResourcesProc countProc;
-
- GetPIResourceProc getProc;
-
- DeletePIResourceProc deleteProc;
-
- AddPIResourceProc addProc;
-
- }
- ResourceProcs;
-
- #define kCurrentResourceProcsCount \
- ((sizeof(ResourceProcs) - offsetof(ResourceProcs, countProc)) / sizeof(void *))
-
- /* Here are the resource types that have been reserved. */
-
- #define kDayStarColorMatchingResource 'DCSR'
-
-
- #define kCurrentHandleProcsVersion 1
-
- typedef struct HandleProcs
- {
-
- int16 handleProcsVersion;
-
- int16 numHandleProcs;
-
- NewPIHandleProc newProc;
-
- DisposePIHandleProc disposeProc;
-
- GetPIHandleSizeProc getSizeProc;
-
- SetPIHandleSizeProc setSizeProc;
-
- LockPIHandleProc lockProc;
-
- UnlockPIHandleProc unlockProc;
-
- RecoverSpaceProc recoverSpaceProc;
-
- }
- HandleProcs;
-
- #define kCurrentHandleProcsCount \
- ((sizeof(HandleProcs) - offsetof(HandleProcs, newProc)) / sizeof(void *))
-
- /*********************************************************************************/
-
- /* The following constants indicate what sort of padding to use. Values 0
- through 255 specify a constant value. Negative values imply special
- operations. */
-
- #define plugInWantsEdgeReplication -1
- #define plugInDoesNotWantPadding -2
- #define plugInWantsErrorOnBoundsException -3
-
- /* If the plug-in does not want padding and does not want errors, then
- exterior areas will contain arbitrary values. */
-
- /*********************************************************************************/
-
- /* The sampling flag indicates the level of sampling support. */
-
- #define hostDoesNotSupportSampling 0
- #define hostSupportsIntegralSampling 1
- #define hostSupportsFractionalSampling 2
-
- /*********************************************************************************/
-
- /* Layout values for filters and export modules. */
-
- #define piLayoutTraditional 0 /* Rows, columns, planes with colbytes = # planes */
- #define piLayoutRowsColumnsPlanes 1
- #define piLayoutRowsPlanesColumns 2
- #define piLayoutColumnsRowsPlanes 3
- #define piLayoutColumnsPlanesRows 4
- #define piLayoutPlanesRowsColumns 5
- #define piLayoutPlanesColumnsRows 6
-
- /*********************************************************************************/
-
- #if defined(__BORLANDC__)
- #pragma option -a.
- #endif
-
- #endif
-
-